/**
 * 获取云配置工具类（包含解码：URL编解码）
 * @author kikolove
 */
import axios from 'axios';
import { message } from 'ant-design-vue';
const apiInstance = axios.create({
    baseURL: 'https://gitee.com/kikolove/imge-load-resource/raw/master/Lumino/',
    timeout: 5000,
    transformResponse: [(data) => {
        return JSON.parse(decodeURIComponent(data));
    }],
});
// 响应拦截器
axios.interceptors.response.use(function (response) {
    return response;
}, function (error) {
    message.error(error.message);
    return Promise.reject(error);
});
export default class CloudConfigUtils {
    static async getLineConfig() {
        const res = await apiInstance.request({
            url: 'config/lineConfig.json' + '?timestamp=' + new Date().getTime(),
            method: 'get',
        })
        return res.data
    }
    static async getUpdateConfig() {
        const res = await apiInstance.request({
            url: 'config/update.json' + '?timestamp=' + new Date().getTime(),
            method: 'get',
        })
        return res.data
    }
}